#!/usr/bin/env bash

echo 'start independent deploying...'

# 阿拉伯数字18作为异常退出码
check='[ $? -eq 0 ] || exit 18'

# install and build
eval "$check" && echo '安装docker'
eval "$check" && bash ../install/docker.sh

if [ ! -d "anomalocaris" ];
then
  eval "$check" && echo '检出 anomalocaris，用于拷贝进docker容器'
  eval "$check" && git clone https://gitee.com/siusn/anomalocaris.git
fi

eval "$check" && docker-compose up

eval "$check" && echo "finish independent deploying！！！"

